--- release-1-3d.orig	2009-12-03 17:05:15.608916799 +0100
+++ release-1-3d	2009-12-14 22:01:06.634927600 +0100
@@ -1035,6 +1035,10 @@
 	  esac
 	elif test "$arg" = "-lm"; then
 	  case $host in
+	  *-*-hpux*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    test "X$arg" = "X-lc" && continue
+	    ;;
 	  *-*-cygwin* | *-*-pw32* | *-*-beos*)
 	    # These systems don't actually have math library (as such)
 	    continue
